home *** CD-ROM | disk | FTP | other *** search
- Path: eccdb1.pms.ford.com!pms991!mbobak
- From: mbobak@pms991.uucp (Mark J. Bobak)
- Newsgroups: comp.lang.c
- Subject: Re: saving system()'s output to a C variable?
- Date: 18 Apr 1996 12:52:00 GMT
- Organization: Not an Official Spokesperson for Ford Motor Company, Dearborn, MI
- Message-ID: <4l5dtg$9d2@eccdb1.pms.ford.com>
- References: <96104.233554U61441@uicvm.uic.edu>
- NNTP-Posting-Host: pms991.pms.ford.com
-
- In article <96104.233554U61441@uicvm.uic.edu>,
- Sikander Waheed <U61441@uicvm.uic.edu> wrote:
- >Hi,
- > Is it possible to save the output of the system() command to
- >a C variable? For example, when I have the line system("date")
- >in my C program, I want the output of this command to go to a
- >C variable (e.g. char array) instead of going on the stdout.
- >Please send me email at swaheed@uic.edu
-
-
- No, not exactly. You can use popen() to open a stream and read the output
- of the command from the stream into a c variable.
-
- -Mark
- --
- Mark J. Bobak, Application Developer
- Advanced Vehicle & Computer Aided Engineering Systems Department
- Process Leadership, Ford Motor Company
- mbobak@ford.com
-